#!/bin/bash

#
# Parameters:
#
# [sysdig path]     run backend with custom sysdig executables path
#

if [ ! -z "$1" ] && [ -e "$1" ]
then
    # or use custom path
    SYSDIG_PATH=$1
else
    SYSDIG_PATH='../sysdig/build/userspace/sysdig'
fi

copy_sysdig() {
    cd ember-electron/resources

    cp -a ../../${SYSDIG_PATH}/ ./sysdig/

    mkdir -p ./sysdig/capture-samples/
    cp ../../capture-samples/502Error.scap ./sysdig/capture-samples/
    cp ../../capture-samples/404Error.scap ./sysdig/capture-samples/

    cd ../..
}

copy_sysdig
